#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    ListNode* swapPairs(ListNode* head) {
        if (head == nullptr || head->next == nullptr) return head;

        ListNode* node = swapPairs(head->next->next);
        ListNode* phead = head->next;
        phead->next = head;
        head->next = node;
        return phead;
    }
};